<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>系统设置 - 管理后台</title>
    <link rel="stylesheet" href="/static/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/public.css" media="all"/>
</head>
<body class="childrenBody">
<div class="layui-col-md12">
    <blockquote class="layui-elem-quote title">
        <span class="layui-breadcrumb">
            <a href="javascript:void(0);">系统设置</a>
            <a><cite>系统设置</cite></a>
        </span>
    </blockquote>
    <table id="configList" lay-filter="configList" class="layui-table"></table>
    <script type="text/html" id="configListTBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    </script>
</div>
<script src="/static/layui.js"></script>
<script>
    layui.use(['element', 'jquery', 'layer', 'table', 'form'], function () {
        var layer = layui.layer,
            $ = layui.jquery,
            table = layui.table;
        var tableIns = table.render({
            elem: '#configList',
            url: '{:url("system/config")}',
            cellMinWidth: 95,
            id: "configListTable",
            cols: [[
                {field: 'name', title: '配置字段', width: 200, align: "center"},
                {field: 'title', title: '配置名称', minWidth: 100, align: "center"},
                {title: '操作', templet: '#configListTBar', fixed:'right', width:150, align:'center'}
            ]]
        });
        table.on('tool(configList)', function (obj) {
            var layEvent = obj.event,
                data = obj.data;
            if (layEvent === 'edit') {
                if(data.type == 'html') {
                    layui.layer.open({
                        title: "编辑配置",
                        type: 2,
                        content: "{:url('system/editConfig')}?name=" + data.name,
                        area: ['500px', '600px']
                    });
                }else {
                    layui.layer.open({
                        title: "编辑配置",
                        type: 2,
                        content: "{:url('system/editConfig')}?name=" + data.name,
                        area: ['500px', '400px']
                    });
                }
            }
        });
    });
</script>
</body>
</html>